/**
 * Copyright 2011 Joe Choi, All rights reserved.
 */

package tao.calendar.gregorian;

/**
 * The Normalizer class is designed for converting an amount of time or date into a valid range
 * 
 * @author Joe Choi
 * @version 1.0.0
 */
class Normalizer {	
	public static long module(long value, long mod) {
		return( ((value % mod) + mod) % mod );
	}

	public static int module(int value, int mod) {
		return( ((value % mod) + mod) % mod );
	}
	
	public static int moduleNonZero(int value, int mod) {
		value = module(--value, mod);
		return(++value);
	}
}
